import {Map} from 'immutable'
import * as actionType from './constant'
const defaultState = Map({
  catagory : [],
  isShowCataroty:false,
  catagorySongs : {},
  currentCatagory: "全部"
})

function reducer(state = defaultState , action){
  switch(action.type){
    case actionType.CHANGE_CATAGORY:
      return state.set("catagory",action.catagory)
    case actionType.CHANGE_IS_SHOW_CATAGORY:
      return state.set("isShowCataroty",action.isShowCataroty)
    case actionType.CHANGE_CATAGORY_SONGS:
      return state.set("catagorySongs",action.catagorySongs)
    case actionType.CHANGE_CURRENT_CATAGORY:
      return state.set("currentCatagory",action.currentCatagory)
    default:
      return state;
  }
}


export default reducer